package chongxin;

public abstract class Pet {
    private String name;
    private String sex;
    private int age;
    private int health;
    private int love;
    //无参和有参的构造方法必须成对出现
    public Pet(){}
    public Pet(String name){
        this.name=name;

    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public int getHealth() {
        return health;
    }
    public void setHealth(int health) {
        this.health = health;
    }
    public int getLove() {
        return love;
    }
    public void setLove(int love) {
        this.love = love;
    }
    public abstract void print();
    public void test(){
        System.out.println("*******"+this.getName());
    }
}
